import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:yt_devops/low_code/components/single_form_item_widget.dart';

///
/// @Description TODO
/// @Author liuer
/// @CreateTime 2023年12月12日 17:39
// ignore: must_be_immutable
class Singleformgroupwidget extends StatelessWidget {
  Singleformgroupwidget({
    Key? key,
    this.title,
    this.richTitle,
    this.valueUpdateCallBack,
    required this.childrens,
  }) : super(key: key);

  final String? title;
  final Widget? richTitle;
  final List<Widget> childrens;
  final Function()? valueUpdateCallBack;

  String? value;

  @override
  Widget build(BuildContext context) {
    return Container(
      // margin: EdgeInsets.only(top: 10.h),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          richTitle ?? Container(),
          (title == null || title!.isEmpty)
              ? Container()
              : Text(
                  title!,
                  style: TextStyle(
                    fontSize: 14.sp,
                    color: Colors.black,
                    fontWeight: FontWeight.bold,
                  ),
                ),
          Container(
            margin: EdgeInsets.only(top: 10.h),
            child: Wrap(
              runSpacing: 10.h,
              spacing: 10.h,
              children: childrens.map((e) {
                return e;
              }).toList(),
            ),
          ),
        ],
      ),
    );
  }
}
